package niuke;

import java.util.Arrays;
import java.util.Scanner;

public class 数字游戏 {
    static int a[];
    static int n;
    static int book[];

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        n = scanner.nextInt();
        a = new int[n];
        int k = 0;
        int sum = 0;
        for(int i=0;i<n;i++){
            a[i] = scanner.nextInt();
        }
        for(int i=0;i<n;i++){
            sum += a[i];
        }
         book = new int[sum+1];
        f(0,0);
        for(k=1;k<=sum;k++){
            if(book[k]==0){
                System.out.println(k);
                return;
            }
        }
        if(k == sum+1){
            System.out.println(sum+1);
        }
    }


    public static void f(int k,int sum){
        if(k == n){
            book[sum] ++;
            return;
        }
        f(k+1,sum);
        f(k+1,sum+a[k]);
    }
}
